package scenario;

import java.util.ArrayList;
//import java.awt.*;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

import main.*;
import terrain.HighWallRect;
import unit.*;
import equipment.*;

public class GoblinHighElfWar extends Game {
	
	public GoblinHighElfWar() {
		Board b = new Board(36, 24);
		File imFile = new File("scenario/Plains_1080_1080.png");
		try {
			b.background = ImageIO.read(imFile);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		HighWallRect t1 = new HighWallRect(18*Utils.pixelsPerInch+100, 12*Utils.pixelsPerInch-100,
											0.5*Utils.pixelsPerInch, 200*Math.sqrt(2), Math.PI/4);
		b.addTerrain(t1);
		board = b;
		b.game = this;
		

		ArrayList<Unit> good = new ArrayList<Unit>();
		ArrayList<Unit> bad = new ArrayList<Unit>();
		
		for (int i = 0; i < 8; i++) {
			Unit gShield = new Goblin(i+100,1,100,15 + 35*i);
			gShield.equip(new Shield());
			Unit gSpear = new Goblin(i+110,1,60,15 + 35*i);
			gSpear.equip(new Spear());
			Unit gBow = new Goblin(i+120,1,20,15 + 35*i);
			gBow.equip(new OrcBow());
			bad.add(gShield);
			bad.add(gSpear);
			bad.add(gBow);
			Unit eBlade = new HighElf(i, 0, 890, 650 - 35*i);
			eBlade.equip(new ElvenBlade());
			good.add(eBlade);
			if (i < 4) {
				Unit eBow = new HighElf(i+10, 0, 930, 650 - 35*i);
				eBow.equip(new ElfBow());
				good.add(eBow);
				Unit eBlade2 = new HighElf(i+20, 0, 930, 490 - 35*i);
				eBlade2.equip(new ElvenBlade());
				good.add(eBlade2);
			}
		}
		
		Army goodArmy = new Army(good, this);
		Army badArmy = new Army(bad, this);
		goodArmy.addToGame(this);
		badArmy.addToGame(this);
		armies[0] = goodArmy;
		armies[1] = badArmy;
		armiesPlaced = true;
		battles = new ArrayList<Battle>();
		priority = 0;
		currArmy = 0;
		currPhase = "Move";
	}
}